mctp_sources = [
  'mctp.cpp',
  'pcie_transport.cpp',
]

libmctp = shared_library(
  'dev_mctp',
  mctp_sources,
  include_directories: dev_inc_dir,
  dependencies: libmcpp_deps,
  install: true,
  install_dir: lib_dir,
)

libmctp_dep = declare_dependency(link_with: libmctp)

install_headers([
  'mctp.h',
  'pcie_transport.h',
], install_dir: install_inc_dir / 'mctp')

if build_tests and meson_build
  custom_target(
    'copy_dev_mctp',
    output: 'copy_dev_mctp',
    command: ['cp', libmctp.full_path(), lib_dir],
    depends: libmctp,
    build_by_default: true,
  )
endif